﻿''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' NOTICE                                                                             '
' -------                                                                            '
' Portions of this source code were taken from the Windows 7 Taskbar Single Instance '
' recipe, which can be found at the following URL:                                   '
' http://code.msdn.microsoft.com/Windows-7-Taskbar-Single-4120eafd                   '
'                                                                                    '
' The Windows 7 Taskbar Single Instance recipe is released under the Apache License, '
' version 2.0. This license is located at the following URL:                         '
' http://www.apache.org/licenses/LICENSE-2.0                                         '
'                                                                                    '
' This program also uses James Newton-King's Json.NET library, which can be found at '
' http://json.codeplex.com/                                                          '
'                                                                                    '
' Json.NET is licensed under the MIT license, which as of 4/11/2011, can be found at '
' http://json.codeplex.com/license                                                   '
'                                                                                    '
' This source code itself is licensed under the MIT license, which can be found at   '
' http://collegiate.codeplex.com/license                                             '
'                                                                                    '
' All mentioned licenses can be found in the Licenses folder provided with this code.'
'                                                                                    '
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Imports System
Imports System.Diagnostics
Imports System.Reflection
Imports System.Windows
Imports System.Windows.Navigation
Imports System.Windows.Media
Imports Microsoft.WindowsAPICodePack.Shell
Imports Microsoft.WindowsAPICodePack.Taskbar
Imports MS.WindowsAPICodePack.Internal

Namespace Collegiate

    ''' <summary>
    ''' Interaction logic for App.xaml
    ''' </summary>
    Partial Public Class App
        Inherits Application
        Private taskbarManager As TaskbarManager = taskbarManager.Instance

        Friend Sub CreateJumpList()
            If CoreHelpers.RunningOnWin7 Then
                Dim cmdPath As String = Assembly.GetEntryAssembly().Location
                Dim jumpList As JumpList = jumpList.CreateJumpList()

                Dim category As New JumpListCustomCategory("Testing")
                category.AddJumpListItems( _
                    New JumpListLink(cmdPath, "Testing") With {.Arguments = "Testing"}, _
                    New JumpListLink(cmdPath, "Test2") With {.Arguments = "Test2"}, _
                    New JumpListLink(cmdPath, "New Assignment") With {.Arguments = "NewAssignment"})
                jumpList.AddCustomCategories(category)

                jumpList.Refresh()
            End If
        End Sub

        Friend Function ProcessCommandLineArgs(ByVal args As String())
            DirectCast(MainWindow, MainWindow).handleCommandLineArgs(args)
            Return Nothing
        End Function
    End Class
End Namespace
